﻿using System;
using System.Collections.Generic;
using System.Linq;
//using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using BL;
using System.IO;
using System.Data;
using System.Configuration;
using System.Collections;

namespace WebsiteBanHang
{
    public partial class ChiTietDonHang : System.Web.UI.Page
    {
        NguoiDung_DAL nd = new NguoiDung_DAL();
        NguoiDungBL nguoiDung = new NguoiDungBL();

        List<SanPhamDAL> dsSanPham = new List<SanPhamDAL>();
        SanPhamDAL sp = new SanPhamDAL();
        SanPhamBL sanPham = new SanPhamBL();

        //giá trị thử
        //string madonhang = "01";
        //string taikhoan = "hien";

        protected void Page_Load(object sender, EventArgs e)
        {
            string madonhang = Request.QueryString["madonhang"]; 
            string taikhoan = Request.QueryString["taikhoan"];

            LayNguoiDungTheoTaiKhoan(taikhoan);
            LayThongTinSanPham();
        }

        protected void LayNguoiDungTheoTaiKhoan(string taikhoan)
        {
            taikhoan = Request.QueryString["taikhoan"];
        
            nd = nguoiDung.LayNguoiDungTheoTaiKhoan(taikhoan);

            txtHoTen.Text = nd.Hoten;
            txtEmail.Text = nd.Email;
            txtSoDienThoai.Text = nd.Sodienthoai;
        }

        public void LayThongTinSanPham()
        {
            string madonhang = Request.QueryString["madonhang"];
            dsSanPham = sanPham.LayDSSanPhamTheoMaDH(madonhang);
            
            GridView1.DataSource = dsSanPham;
            GridView1.DataBind();
        }

       
    }
}